package com.jiajia.study.controller;

import com.jiajia.study.grace.result.GraceJSONResult;
import com.jiajia.study.pojo.Stu;
import com.jiajia.study.service.IStuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zjiajia
 * @date 2024/4/28 15:15
 */

@RestController
@Slf4j
@RequestMapping("stu")
public class HelloController {

    @Autowired
    private IStuService stuService;


    @GetMapping("save")
    public GraceJSONResult save(){
        Stu stu = new Stu();
        stu.setAge(10);
        stu.setName("测试");
        stuService.save(stu);

        return GraceJSONResult.ok();
    }



}
